//
//  ManagementAddressVC.m
//  hnGovernment
//
//  Created by 安仔 on 17/3/8.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "ManagementAddressVC.h"
#import "ManagementAddressCell.h"

@interface ManagementAddressVC ()<UITableViewDelegate, UITableViewDataSource, ManagementAddressCellDelegate>
@property (nonatomic, strong) UITableView *myTableView;

@end

@implementation ManagementAddressVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = BackgroundColor;
    self.title = NSLocalString(@"关于我们");
    
    UIBarButtonItem *rightbuttonItem = [[UIBarButtonItem alloc]initWithTitle:@"新增" style:UIBarButtonItemStylePlain target:self action:@selector(rightFun)];
    [rightbuttonItem setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]} forState:UIControlStateNormal];
    self.navigationItem.rightBarButtonItem = rightbuttonItem;
    
    self.myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight - 128 * m6Scale) style:UITableViewStyleGrouped];
    self.myTableView.delegate = self;
    self.myTableView.dataSource = self;
    self.myTableView.backgroundColor = BackgroundColor;
    self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:self.myTableView];

}

- (void)rightFun {
    
}


#pragma mark - UITableView
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 234 * m6Scale;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 20 * m6Scale;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.01;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ManagementAddressCell *cell = [self.myTableView dequeueReusableCellWithIdentifier:@"addressCell"];
    if (!cell) {
        cell = [[ManagementAddressCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"addressCell"];
        cell.delegate = self;
    }
    
    return cell;
}


#pragma mark - cell中的代理方法
- (void)ManagementAddressCellClickSelectedBtn {
    NSLog(@"133");
}

- (void)ManagementAddressCellClickDeleteBtn {

}

- (void)ManagementAddressCellClickEditBtn {

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
